package part9.client;

import part9.interpreter.Interpreter;
import part9.interpreter.Lexer;
import part9.interpreter.Parser;

import java.io.BufferedReader;
import java.io.FileReader;

public class Main {
    public static void main(String[] args) throws Exception {
        FileReader fileReader = new FileReader("testFile/assignments.txt");
        BufferedReader bufferedReader = new BufferedReader(fileReader);
        StringBuilder codeText = new StringBuilder();
        String line;
        while ((line = bufferedReader.readLine()) != null) {
            codeText.append(line);
        }
        Lexer lexer = new Lexer(codeText.toString());
        Parser parser = new Parser(lexer);
        Interpreter interpreter = new Interpreter(parser);
        Object result = interpreter.interpret();
        System.out.println(interpreter.getGlobalScope());
    }
}
